#ifndef H_NYMPHAEA_COMM_FUNCTORS
#define H_NYMPHAEA_COMM_FUNCTORS
/*
 * project: nymphaea
 * module: comm::functors
 * purpose: functors using in project
 * creation date: 2010-MAY-23
 * created by: kaby<entelechie@gmail.com>
 * license: GNU General Public License v3
 */

#include <algorithm>
#include <cmath>

namespace nymphaea
{

namespace comm
{

class Exp : public std::unary_function<double, double>
{
public:
	double operator()(double x) const
	{
		return  exp(x);
	}
};

class Abs : public std::unary_function<double, double>
{
public:
	double operator()(double x) const
	{
		return  fabs(x);
	}
};

class Sqrt : public std::unary_function<double, double>
{
public:
	double operator()(double x) const
	{
		return  sqrt(x);
	}
};

class Ln : public std::unary_function<double, double>
{
public:
	double operator()(double x) const
	{
		return  log(x);
	}
};

class Pow : public std::binary_function<double, double, double>
{
public:
	double operator()(double x, double y) const
	{
		return  pow(x, y);
	}
};

class Mod : public std::binary_function<double, double, double>
{
public:
	double operator()(double x, double y) const
	{
		return  fmod(x, y);
	}
};

}
}
#endif
